Page({
  data: {
    activePage: 'home',
    topTitle: '主页',
    // 删除蓝牙相关数据
    // showBluetoothList: false,
    // bluetoothList: [],
    // selectedDeviceId: null,
    // selectedDeviceName: null
    connectionStatus: -1,
    wifiList: []
  },

  changePage(e) {
    const page = e.currentTarget.dataset.page;

    // 若点击切换的组件为当前显示组件则不做处理
    if (page === this.data.activePage) {
      return;
    }

    let title = '';
    switch (page) {
      case 'home':
        title = '主页';
        break;
      case 'aiRole':
        title = '角色列表';
        break;
      case 'timbre':
        title = '音色选择';
        break;
      case 'system':
        title = '设置';
        break;
    }

    this.setData({
      activePage: page,
      topTitle: title
    });
  },

  // 删除蓝牙相关方法
  // searchBluetooth() { ... },
  // hideBluetoothList() { ... },
  // selectDevice(e) { ... },
  // connectAndHide() { ... },

  onLoad(options) {

  },

  onReady() {

  },

  onShow() {
    
  },

  onHide() {
  },

  onUnload() {
  },

  onPullDownRefresh() {
  },

  onReachBottom() {
  },

  onShareAppMessage() {
  },

  changeActive(e) {
    const page = e.currentTarget.dataset.page;
    let title = '';
    switch (page) {
      case 'home':
        title = '主页';
        break;
      case 'timbre':
        title = '音色选择';
        break;
      case 'role':
        title = '角色列表';
        break;
      case 'system':
        title = '设置';
        break;
    }
    this.setData({
      activePage: page,
      topTitle: title
    });
  },

})